package cn.kxlove.zhbj.domain.respone;

import org.xutils.http.annotation.HttpResponse;

import java.util.ArrayList;

import cn.kxlove.zhbj.utils.JsonResponseParser;

/**
 * @author kxlove 16/1/27 21:09
 */
@HttpResponse(parser = JsonResponseParser.class)
public class NewsMenuBean {

    public int retcode;
    public ArrayList<String> extend;
    public ArrayList<NewsMenuData> data;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        NewsMenuBean that = (NewsMenuBean) o;

        if (retcode != that.retcode) return false;
        if (extend != null ? !extend.equals(that.extend) : that.extend != null) return false;
        return data != null ? data.equals(that.data) : that.data == null;

    }

    @Override
    public int hashCode() {
        int result = retcode;
        result = 31 * result + (extend != null ? extend.hashCode() : 0);
        result = 31 * result + (data != null ? data.hashCode() : 0);
        return result;
    }

    /**
     * 侧边栏菜单对象
     */
    public class NewsMenuData {
        public String id;
        public String title;
        public int type;
        public ArrayList<NewsTabData> children;

        @Override
        public String toString() {
            return "NewsMenuData [title=" + title + ", children=" + children
                    + "]";
        }
    }

    /**
     * 页签的对象
     */
    public class NewsTabData {
        public String id;
        public String title;
        public String url;
        public int type;

        @Override
        public String toString() {
            return "NewsTabData [title=" + title + "]";
        }
    }

    @Override
    public String toString() {
        return "NewsMenuBean [data=" + data + "]";
    }
}
